<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>






    </style>
</head>

<body>
    <div id="app">
        <div :is=view></div><!-- v-bind:-->
        <button v-on:click="change">转换页面</button>
    </div>



    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script src="node_modules/vue/dist/vue.js"></script>
    <script>
        Vue.component("home", {
            template: "<div>主页</div>"
        })

        Vue.component("about", {
            template: "<div>关于</div>"
        })

        Vue.component("list", {
            template: "<div>列表</div>"
        })
        
        var vm = new Vue({
            el: "#app",
            data: {
                view: 'home'
            },
            methods: {
                change: function () {
                    this.view="about";

                }
            }

        })
    </script>
</body>

</html>